<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    class Stu {
        constructor(name, age) {
            this.name = name;
            this.age = age;
        }

        get() {
            return this.name + ':' + this.age
        }

        set(name, age) {
            this.name = name;
            this.age = age;
        }

        toString() {
            return this.get();
        }
    }

    class ChildStu extends Stu {
        constructor(name, age, address) {
            super(name, age);
            this.address = address;
        }

        toString() {
            return super.toString() + ':' + this.address;
        }
    }

    let stu = new Stu('zing', 22);
    console.log(stu.get());
    console.log(stu.toString());
    let childStu = new ChildStu('zhang',11,'wuxi');
    console.log(childStu);
    console.log(childStu.toString());


</script>
</body>
</html>